//
//  JAGAdxRequest.h
//  JAGatherAdSDK
//
//  Created by Yc on 2022/12/6.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// 请求成功的回调;
typedef void (^SuccessBlock)(id responseDict);
// 请求失败的回调;
typedef void (^FailureBlock)(NSError *error);

@interface JAGAdxRequest : NSObject

+ (instancetype)sharedManager;

/**
 GET 网络请求
 
 @param url 请求接口;
 @param params 请求参数;
 @param success 请求成功的回调;
 @param failure 请求失败的回调;
 */
- (void)GET:(NSString*)url
    params:(nullable NSDictionary*)params
   success:(SuccessBlock)success
    failure:(FailureBlock)failure;

/**
 Post 网络请求
 
 @param url 请求接口;
 @param params 请求参数;
 @param success 请求成功的回调;
 @param failure 请求失败的回调;
 */
- (void)POST:(NSString *)url
      params:(nullable NSDictionary *)params
     success:(SuccessBlock)success
     failure:(FailureBlock)failure;

@end

NS_ASSUME_NONNULL_END
